/*
 Navicat Premium Data Transfer

 Source Server         : 本机
 Source Server Type    : MySQL
 Source Server Version : 80027 (8.0.27)
 Source Host           : localhost:3306
 Source Schema         : hc_server

 Target Server Type    : MySQL
 Target Server Version : 80027 (8.0.27)
 File Encoding         : 65001

 Date: 18/03/2024 15:06:00
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for agents
-- ----------------------------
DROP TABLE IF EXISTS `agents`;
CREATE TABLE `agents` (
                          `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '''id''',
                          `created_at` datetime(3) DEFAULT NULL,
                          `updated_at` datetime(3) DEFAULT NULL,
                          `deleted_at` datetime(3) DEFAULT NULL,
                          `agent_name` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '''代理名称''',
                          `mobile` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
                          `password` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '''密码''',
                          `sex` tinyint DEFAULT NULL COMMENT '''性别 1男 2女''',
                          `id_card` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '''身份证''',
                          `agent_no` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '''代理商编号''',
                          `agent_relation` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '''代理商关系''',
                          `email` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '''邮箱''',
                          `account_status` tinyint DEFAULT NULL COMMENT '''账户状态 1已启用 2未启用''',
                          `auth_status` tinyint DEFAULT NULL COMMENT '''认证状态 1已认证 2未认证''',
                          `base_agent_id` bigint DEFAULT NULL COMMENT '''所属代理商''',
                          `activity_id` bigint DEFAULT NULL COMMENT '''活动政策id''',
                          PRIMARY KEY (`id`),
                          UNIQUE KEY `mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


BEGIN;
INSERT INTO `agents` (`id`, `created_at`, `updated_at`, `deleted_at`, `agent_name`, `mobile`, `password`, `sex`, `id_card`, `agent_no`, `agent_relation`, `email`, `account_status`, `auth_status`, `base_agent_id`, `activity_id`) VALUES (1, '2024-02-28 10:57:54.000', '2024-02-28 10:57:57.000', NULL, '管理员', '13998152193', 'c4ca4238a0b923820dcc509a6f75849b', NULL, NULL, '000000', '1', NULL, NULL, NULL, NULL, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
-- Records of agents
-- ----------------------------


-- ----------------------------
-- Table structure for agent_relations
-- ----------------------------

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

DROP TABLE IF EXISTS `agent_relations`;
CREATE TABLE `agent_relations` (
                                   `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '''id''',
                                   `created_at` datetime(3) DEFAULT NULL,
                                   `updated_at` datetime(3) DEFAULT NULL,
                                   `deleted_at` datetime(3) DEFAULT NULL,
                                   `agent_id` bigint DEFAULT NULL COMMENT '''代理商ID''',
                                   `superior_id` bigint DEFAULT NULL COMMENT '''上级代理ID''',
                                   `relation` longtext COLLATE utf8mb4_general_ci COMMENT '''代理关系 逗号隔开''',
                                   `base_agent_id` bigint DEFAULT NULL COMMENT '''所属代理商id''',
                                   PRIMARY KEY (`id`),
                                   UNIQUE KEY `agent_id` (`agent_id`),
                                   UNIQUE KEY `agent_id_2` (`agent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

BEGIN;
INSERT INTO `agent_relations` (`id`, `created_at`, `updated_at`, `deleted_at`, `agent_id`, `superior_id`, `relation`, `base_agent_id`) VALUES (1, '2024-02-28 10:59:38.000', '2024-02-28 10:59:39.000', NULL, 1, 1, '1', 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
-- Records of agent_relations
-- ----------------------------

-- ----------------------------
-- Table structure for merchant_shop_types
-- ----------------------------
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;


DROP TABLE IF EXISTS `merchant_shop_types`;
CREATE TABLE `merchant_shop_types` (
                                       `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '''id''',
                                       `created_at` datetime(3) DEFAULT NULL,
                                       `updated_at` datetime(3) DEFAULT NULL,
                                       `deleted_at` datetime(3) DEFAULT NULL,
                                       `info` longtext COMMENT '''名称''',
                                       PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3;

BEGIN;
INSERT INTO `merchant_shop_types` (`id`, `created_at`, `updated_at`, `deleted_at`, `info`) VALUES (1, '2024-03-07 09:21:18.000', '2024-03-07 09:21:20.000', NULL, '主店');
INSERT INTO `merchant_shop_types` (`id`, `created_at`, `updated_at`, `deleted_at`, `info`) VALUES (2, '2024-03-07 09:22:16.000', '2024-03-07 09:22:17.000', NULL, '独立结算分店');
INSERT INTO `merchant_shop_types` (`id`, `created_at`, `updated_at`, `deleted_at`, `info`) VALUES (3, '2024-03-07 09:22:28.000', '2024-03-07 09:22:30.000', NULL, '合并结算分店');
INSERT INTO `merchant_shop_types` (`id`, `created_at`, `updated_at`, `deleted_at`, `info`) VALUES (4, '2024-03-01 14:44:50.000', '2024-03-01 14:44:52.000', NULL, '分账接收方');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
-- Records of merchant_shop_types
-- ----------------------------

-- ----------------------------
-- Table structure for merchant_types
-- ----------------------------

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;


DROP TABLE IF EXISTS `merchant_types`;
CREATE TABLE `merchant_types` (
                                  `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '''id''',
                                  `created_at` datetime(3) DEFAULT NULL,
                                  `updated_at` datetime(3) DEFAULT NULL,
                                  `deleted_at` datetime(3) DEFAULT NULL,
                                  `info` longtext COMMENT '''名称''',
                                  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3;

BEGIN;
INSERT INTO `merchant_types` (`id`, `created_at`, `updated_at`, `deleted_at`, `info`) VALUES (1, '2024-03-07 09:21:18.000', '2024-03-07 09:21:20.000', NULL, '小微商户');
INSERT INTO `merchant_types` (`id`, `created_at`, `updated_at`, `deleted_at`, `info`) VALUES (2, '2024-03-07 09:22:16.000', '2024-03-07 09:22:17.000', NULL, '个体商户');
INSERT INTO `merchant_types` (`id`, `created_at`, `updated_at`, `deleted_at`, `info`) VALUES (3, '2024-03-07 09:22:28.000', '2024-03-07 09:22:30.000', NULL, '企业商户');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
-- Records of merchant_types
-- ----------------------------

-- ----------------------------
-- Table structure for agent_rates
-- ----------------------------

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;


DROP TABLE IF EXISTS `agent_rates`;
CREATE TABLE `agent_rates` (
                               `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '''id''',
                               `created_at` datetime(3) DEFAULT NULL,
                               `updated_at` datetime(3) DEFAULT NULL,
                               `deleted_at` datetime(3) DEFAULT NULL,
                               `agent_id` bigint DEFAULT NULL COMMENT '''代理商id''',
                               `wechat_min` double DEFAULT NULL COMMENT '''微信费率最小值''',
                               `wechat_max` double DEFAULT NULL COMMENT '''微信费率最大值''',
                               `alipay_min` double DEFAULT NULL COMMENT '''支付宝费率最小值''',
                               `alipay_max` double DEFAULT NULL COMMENT '''支付宝费率最大值''',
                               `yun_pay_low_min` double DEFAULT NULL COMMENT '''云闪付费率<=1000元 最小值''',
                               `yun_pay_low_max` double DEFAULT NULL COMMENT '''云闪付费率<=1000元 最大值''',
                               `yun_pay_high_min` double DEFAULT NULL COMMENT '''云闪付费率>1000元 最小值''',
                               `yun_pay_high_max` double DEFAULT NULL COMMENT '''云闪付费率>1000元 最大值''',
                               `debit_card_min` double DEFAULT NULL COMMENT '''刷卡储蓄卡费率 最小值''',
                               `debit_card_max` double DEFAULT NULL COMMENT '''刷卡储蓄卡费率 最大值''',
                               `debit_card_capping_min` double DEFAULT NULL COMMENT '''刷卡储蓄卡封顶手续费 最小值''',
                               `debit_card_capping_max` double DEFAULT NULL COMMENT '''刷卡储蓄卡封顶手续费 最大值''',
                               `credit_card_min` double DEFAULT NULL COMMENT '''刷卡信用卡费率 最小值''',
                               `credit_card_max` double DEFAULT NULL COMMENT '''刷卡信用卡费率 最大值''',
                               `rate_type` bigint DEFAULT NULL COMMENT '''费率类型 0=D0 1=D1''',
                               `type` bigint DEFAULT '0' COMMENT '''是否编辑过 0=未编辑过 1=编辑过''',
                               PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8mb3;


BEGIN;
INSERT INTO `agent_rates` (`id`, `created_at`, `updated_at`, `deleted_at`, `agent_id`, `wechat_min`, `wechat_max`, `alipay_min`, `alipay_max`, `yun_pay_low_min`, `yun_pay_low_max`, `yun_pay_high_min`, `yun_pay_high_max`, `debit_card_min`, `debit_card_max`, `debit_card_capping_min`, `debit_card_capping_max`, `credit_card_min`, `credit_card_max`, `rate_type`, `type`) VALUES (1, '2024-03-20 14:15:53.000', '2024-03-20 14:15:55.000', NULL, 1, 0.23, 0.38, 0.23, 0.38, 0.23, 0.38, 0.53, 0.6, 0.42, 0.6, 19, 35, 0.53, 0.6, 0, 0);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;

-- ----------------------------
-- Records of agent_rates
-- ----------------------------

-- ----------------------------
-- Table structure for agent_settlement_rates
-- ----------------------------

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;


DROP TABLE IF EXISTS `agent_settlement_rates`;
CREATE TABLE `agent_settlement_rates` (
                                          `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '''id''',
                                          `created_at` datetime(3) DEFAULT NULL,
                                          `updated_at` datetime(3) DEFAULT NULL,
                                          `deleted_at` datetime(3) DEFAULT NULL,
                                          `agent_id` bigint DEFAULT NULL COMMENT '''代理商ID''',
                                          `d0_settlement_rate_min` double DEFAULT NULL COMMENT '''D0付款结算分润百分比 最小值''',
                                          `d0_settlement_rate_max` double DEFAULT NULL COMMENT '''D0付款结算分润百分比 最大值''',
                                          `d0_settlement_min` double DEFAULT NULL COMMENT '''D0付款结算分润手续费 最小值''',
                                          `d0_settlement_max` double DEFAULT NULL COMMENT '''D0付款结算分润手续费 最大值''',
                                          `d1_settlement_rate_min` double DEFAULT NULL COMMENT '''D1付款结算分润百分比 最小值''',
                                          `d1_settlement_rate_max` double DEFAULT NULL COMMENT '''D1付款结算分润百分比 最大值''',
                                          `d1_settlement_min` double DEFAULT NULL COMMENT '''D1付款结算分润手续费 最小值''',
                                          `d1_settlement_max` double DEFAULT NULL COMMENT '''D1付款结算分润手续费 最大值''',
                                          `withdrawal_rate_min` double DEFAULT NULL COMMENT '''提现费率百分比 最小值''',
                                          `withdrawal_rate_max` double DEFAULT NULL COMMENT '''提现费率百分比 最大值''',
                                          `withdrawal_min` double DEFAULT NULL COMMENT '''提现手续费 最小值''',
                                          `withdrawal_max` double DEFAULT NULL COMMENT '''提现手续费 最大值''',
                                          `type` bigint DEFAULT '0' COMMENT '''是否编辑过 0=未编辑过 1=编辑过''',
                                          PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb3;


BEGIN;
INSERT INTO `agent_settlement_rates` (`id`, `created_at`, `updated_at`, `deleted_at`, `agent_id`, `d0_settlement_rate_min`, `d0_settlement_rate_max`, `d0_settlement_min`, `d0_settlement_max`, `d1_settlement_rate_min`, `d1_settlement_rate_max`, `d1_settlement_min`, `d1_settlement_max`, `withdrawal_rate_min`, `withdrawal_rate_max`, `withdrawal_min`, `withdrawal_max`, `type`) VALUES (1, '2024-03-21 10:00:24.000', '2024-03-21 10:00:25.000', NULL, 1, 0, 1, 0, 5, 0, 1, 0, 5, 0.02, 0.02, 0, 0, 0);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
-- ----------------------------
-- Records of agent_settlement_rates
-- ----------------------------
